package com.black.app.domain.req.my.myorders;

import cn.hutool.core.util.StrUtil;
import com.black.common.core.domain.page.PageAbstructReq;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

@Getter
@Setter
@ToString(callSuper = true)
@ApiModel(value = "MyOrdersQueryReq", description = "我的订单查询请求对象")
public class MyOrdersQueryReq extends PageAbstructReq {

    /**
     * 订单ID
     */
    @ApiModelProperty(value = "订单ID")
    private Integer orderId;

    /**
     * 用户ID
     */
    @ApiModelProperty(value = "用户ID")
    private String userId;

    /**
     * 订单编号
     */
    @ApiModelProperty(value = "订单编号")
    private String orderCode;

    /**
     * 订单状态
     */
    @ApiModelProperty(value = "订单状态(0未支付，1待发货，2已发货，3已完成  4 退货)")
    private Integer orderStatus;

    /**
     * 排序
     *
     */
    @ApiModelProperty(hidden = true)
    @Override
    public String getOrderBy() {
        if (StrUtil.isNotBlank(super.getOrderByColumn())){
            return super.getOrderByColumn() + " " + super.getIsAsc();
        }
        return null;
    }
}
